package com.wlhse.entity;

import lombok.Data;

@Data
public class MonthProblemAnalysisPojo {
    private Integer Jan;
    private Integer Feb;
    private Integer Mar;
    private Integer Apr;
    private Integer May;
    private Integer Jun;
    private Integer July;
    private Integer Aug;
    private Integer Sep;
    private Integer Oct;
    private Integer Nove;
    private Integer Dece;
    private String Field;
    private Integer total;
    private Double percent;

    public MonthProblemAnalysisPojo(String field) {
        Jan = 0;
        Feb = 0;
        Mar = 0;
        Apr = 0;
        May = 0;
        Jun = 0;
        July = 0;
        Aug = 0;
        Sep = 0;
        Oct = 0;
        Nove = 0;
        Dece = 0;
        Field = field;
    }

    public MonthProblemAnalysisPojo() {
    }

    public Integer getTotals(){
        return Jan+Feb+Mar+Apr+May+Jun+July+Aug+Sep+Oct+Nove+Dece;
    }

    public Object getMonthCount(int month) {
        Integer monthCount=0;
        switch (month){
            case 1:
                monthCount=Jan;
                break;
            case 2:
                monthCount=Feb;
                break;
            case 3:
                monthCount=Mar;
                break;
            case 4:
                monthCount=Apr;
                break;
            case 5:
                monthCount=May;
                break;
            case 6:
                monthCount=Jun;
                break;
            case 7:
                monthCount=July;
                break;
            case 8:
                monthCount=Aug;
                break;
            case 9:
                monthCount=Sep;
                break;
            case 10:
                monthCount=Oct;
                break;
            case 11:
                monthCount=Nove;
                break;
            case 12:
                monthCount=Dece;
                break;
        }
        return monthCount;
    }
}
